# -*- coding: utf-8 -*-
# File : controller.py
# Author: taoyahui
# Date : 2021/3/25
from flask import request
from tasks import *
from flask import Flask
import json
from web.service import *

app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello World!'


# 方法：POST
# 传入参数 ip, 用户名， 密码
@app.route('/deploy_admin',methods=['POST'])
def test_post():
    post_body = json.load(request.data)
    print(post_body)
    resp = deploy_admin_service(post_body)
    return resp


@app.route('/check_local', methods=['GET'])
def check_local():
    resp = get_local_sys()
    return resp


if __name__ == '__main__':
    app.run()
